Client Side Events

RapidSpell Web provides an interface to the various events and functions present on the client side in Javascript (ECMAscript). This allows further behaviour customization when the spell checker is used in popup mode. The current highlights are;

Notification of the spell check finished event
Notification that the user has corrected a word
Exposure of the Javascript function that launches the spell checking

FinishedListener - Finished Event

It is possible to determine when spell checking has finished (in pop up mode) by using the FinishedListener property of RapidSpellWebLauncher. This property can be set to the name of a JavaScript function in the main form, which will be called from the pop up when the user finishes checking the document (either by completing the check, closing the window, or by clicking the 'Finish' button). The function must not expect arguments, unless the FinishedListenerInformState is set true and be with in the scope of the whole page (if FinishedListenerInformState=true then the argument is true if spell check completed, false if cancelled).

For example;

...............
<script>
    function notifyDone(){
        alert('Finished event captured.');
    }
</script>
...............
<RapidSpellWeb:RapidSpellWebLauncher id="rapidSpellWebLauncher" runat="server"
    TextComponentName="myForm.sourceTextBox"
    TextComponentInterface="Standard"
    FinishedListener="notifyDone"
    Mode="popup"
    SeparateHyphenWords=true
    RapidSpellWebPage="RapidSpellCheckerPopUp.aspx"/>
...............

CorrectionNotifyListener - User Correction Event

To be notified every time that the user has corrected a word, set the CorrectionNotifyListener property of RapidSpellWebLauncher to the name part of a Javascript function present on the main page.

For example;

...............
<script>
    function OnCorrection(startIndex, oldWord, newWord){
        alert('Correction occured to word at index '+startIndex+' old word
was '+oldWord+' replacement text is '+newWord);
    }
</script>
...............
<RapidSpellWeb:RapidSpellWebLauncher id="rapidSpellWebLauncher" runat="server"
    TextComponentName="myForm.sourceTextBox"
    TextComponentInterface="Standard"
    CorrectionNotifyListener="OnCorrection"
    Mode="popup"
    RapidSpellWebPage="RapidSpellCheckerPopUp.aspx"/>
...............